import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
/******************HOME****************** */
import Home from '@/views/home/index'
/**************************************** */

/******************MATCH****************** */
import Match from '@/views/match/index'
import MatchHome from '@/views/match/home'
import MatchDetail from '@/views/match/detail/index'
import MatchRules from '@/views/match/matchRules/index'
import MatchDetailGoing from '@/views/match/detail/MatchDetailGoing'
import MatchDetailNoGoing from '@/views/match/detail/MatchDetailNoGoing'
import MatchDetailEnd from '@/views/match/detail/MatchDetailEnd'
import signForm from '@/views/match/detail/signForm'
import matchSchedule from '@/views/match/detail/matchSchedule'

// apply
import MatchApply from '@/views/match/apply/index'
import MatchApplyForm from '@/views/match/apply/applyForm'
import checkApply from '@/views/match/apply/checkApply'
import MatchHave from '@/views/match/detail/components/have'
import MatchCheck from '@/views/match/detail/components/endCheck'
import HasSign from '@/views/match/components/hasSign'

/**************************************** */

/******************DESIGN****************** */
import Design from '@/views/design/index'
/**************************************** */

/******************ABOUT****************** */
import About from '@/views/about/index'
/**************************************** */

/******************MINE****************** */
import Mine from '@/views/mine/index'
import MineHome from '@/views/mine/home'
import SetInfo from '@/views/mine/setInfo'
import NewMatch from '@/views/mine/newMatch'
import MineData from '@/views/mine/my_data'
import umpire_apply from '@/views/mine/umpire_apply'
import organization_apply from '@/views/mine/organization_apply'
/**************************************** */

/******************USER****************** */
import User from '@/views/user/index'
import Login from '@/views/user/login'
import Register from '@/views/user/register'
import Repwd from '@/views/user/repwd'
/**************************************** */

export default new Router({
  routes: [{
      path: '/',
      component: Home
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/match',
      component: Match,
      children: [{
          path: '',
          component: MatchHome
        },
        {
          path: 'detail',
          component: MatchDetail,
          children: [{
            path: '/',
            component: MatchDetailGoing,
          }, {
            path: 'MatchDetailNoGoing',
            component: MatchDetailNoGoing,
          }, {
            path: 'MatchDetailGoing',
            component: MatchDetailGoing,
          }, {
            path: 'MatchDetailEnd',
            component: MatchDetailEnd,
          }, {
            path: 'signForm',
            component: signForm,
          }, {
            path: 'matchSchedule',
            component: matchSchedule,
          }
        ]
        },
        {
          path: 'apply',
          component: MatchApply,
        }, {
				  path: 'MatchRules',
				  component: MatchRules,
				},{
				  path: 'HasSign',
				  component: HasSign,
				},
        {
          path: 'applyForm',
          component: MatchApplyForm,
          meta: {
            auth: true
          }
        },
        {
          path: 'checkApply',
          component: checkApply,
        },
        {
          path: 'endCheck',
          component: MatchCheck
        }
      ]
    },
    {
      path: '/have',
      component: MatchHave
    },
    {
      path: '/design',
      component: Design
    },
    {
      path: '/about',
      component: About
    },
    //个人中心
    {
      path: '/mine',
      component: Mine,
      children: [{
          path: '',
          component: MineHome,
          // meta:{auth:false}
        },
        {
          path: 'setInfo',
          component: SetInfo,
        },
        {
          path: 'newmatch',
          component: NewMatch,
        },
        {
          path: 'my_data',
          component: MineData,
        },
        {
          path: 'umpire_apply',
          component: umpire_apply,
        },
        {
          path: 'organization_apply',
          component: organization_apply,
        },
      ],
      meta: {
        auth: true
      }
    },
    //login-register-rewpwd
    {
      path: '/user',
      component: User,
      children: [{
          path: 'login',
          component: Login,
        },
        {
          path: 'register',
          component: Register,
        },
        {
          path: 'repwd',
          component: Repwd,
        },
      ]
    },
  ],
  scrollBehavior: () => ({
    x: 0,
    y: 0
  }),
})
